package com.xiaozhichao.javaapi.designpattern.builder;

import com.xiaozhichao.javaapi.designpattern.factory.MailSender;
import com.xiaozhichao.javaapi.designpattern.factory.Sender;
import com.xiaozhichao.javaapi.designpattern.factory.SmsSender;

import java.util.ArrayList;
import java.util.List;

/**
 *  工厂类模式提供的是创建单个类的模式，而建造者模式则是将各种产品集中起来进行管理，用来创建复合对象，所谓复合对象就是指某个类具有不同的属性
 */
public class Builder {

    private List<Sender> list = new ArrayList<>();

    public void produceMailSender(int count){
        for(int i=0; i<count; i++){
            list.add(new MailSender());
        }
    }

    public void produceSmsSender(int count){
        for(int i=0; i<count; i++){
            list.add(new SmsSender());
        }
    }
}
